<div id="digg">
	<span>
		<strong id="diggDivCount_{$contentid}">0</strong><br />
		<samp id="diggDivDo_{$contentid}" onclick="digg(1)" >顶一下</samp>
	</span>
	<span class="cai">
		<strong id="diggDivCount_down_{$contentid}">0</strong><br />
		<samp id="diggDivDo_down_{$contentid}" onclick="digg(0)" >踩一下</samp>
	</span>
</div>
<script type="text/javascript">
var digg_listurl = "<a href='{$MODULE[digg][url]}?catid={$r[catid]}' target='_blank' class='orange'>查看</a>";
$.get('{$MODULE[digg][url]}digg.php?contentid={$contentid}&id='+Math.random()*5, function(data){
	 var data = data.split(',');
	 $('#diggDivCount_{$contentid}').html(data[1]);
	 $('#diggDivCount_down_{$contentid}').html(data[2]);
     if(data[0] == 1)
	 {
		 $('#diggDivDo_{$contentid}').html(digg_listurl);
		 $('#diggDivDo_down_{$contentid}').html(digg_listurl);
	 }
});
function digg(id)
{
	if(id)
	{
		$.get('{$MODULE[digg][url]}digg.php?contentid={$contentid}&flag=1', function(data){
		     if(data > 0) $('#diggDivCount_{$contentid}').html(data);
			 $('#diggDivDo_{$contentid}').html(digg_listurl);
		});
	}
	else
	{
		$.get('{$MODULE[digg][url]}digg.php?contentid={$contentid}&flag=0', function(data){
		     if(data > 0) $('#diggDivCount_down_{$contentid}').html(data);
			 $('#diggDivDo_down_{$contentid}').html(digg_listurl);
		});
	}
}
</script>